Groups the elements of a collection according to a specified key selector function.
Namespace:
C1.LiveLinqAssembly: C1.LiveLinq (in C1.LiveLinq.dll)
Syntax
C# |
---|
public static IIndexedSource<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>( this IIndexedSource<TSource> source, Expression<Func<TSource, TKey>> keySelector ) |
Visual Basic |
---|
<ExtensionAttribute> _ Public Shared Function GroupBy(Of TSource, TKey) ( _ source As IIndexedSource(Of TSource), _ keySelector As Expression(Of Func(Of TSource, TKey)) _ ) As IIndexedSource(Of IGrouping(Of TKey, TSource)) |
Parameters
- source
- Type: C1.LiveLinq.Indexing..::..IIndexedSource<(Of <(<'TSource>)>)>
An IIndexedSource<(Of <(<'T>)>)> whose elements to group
- keySelector
- Type: System.Linq.Expressions..::..Expression<(Of <(<'Func<(Of <(<'TSource, TKey>)>)>>)>)>
A function to extract the key for each element.
Type Parameters
- TSource
- The type of the elements of source.
- TKey
- The type of the key returned by keySelector.